<template>
  <div class="main">
    <Header ref="header"/>
    <Nuxt/>
    <Footer ref="footer"/>
    <!-- 只在客户端渲染，服务端不处理 -->
    <client-only>
      <LazyLogin ref="login" :visible="showLoginDialog" @close="showLoginDialog=false"/>
      <!--      <el-backtop :bottom="100"/>-->
      <GlobalToolbar/>
      <Lucky/>
    </client-only>

  </div>
</template>
<script>
import CursorSpecialEffects from "@/utils/cursor-effects";

export default {
  name: "BaseLayout",
  data() {
    return {
      showLoginDialog: false,
      cse: null,
    }
  },
  methods: {
    showLogin() {
      //其实可以换成更好的store方式
      this.showLoginDialog = true;
    },
    boom({x, y}) {
      //点击放烟花
      if (this.cse) {
        this.cse.handleMouseDown({clientX: x, clientY: y});
      }
    }
  },
  mounted() {
    if (process.browser) {
      this.cse = new CursorSpecialEffects();
      this.cse.init();
    }
  },
  head() {
    return {
      script: [
        {type: "text/javascript", src: "https://v1.cnzz.com/z_stat.php?id=1278120043&web_id=1278120043"}
      ]
    }
  }
}
</script>
